﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrgAdmin.aspx.cs" Inherits="EuroAudit.OrgAdmin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Partneru saraksts</title>
    <script type="text/javascript">
    
      function pageLoad() {
      }
    
    </script>
    <script type="text/javascript" language="javacript">
        <!--
        function Window_OnUnLoad()
        {
           //On Error Resume Next
           Parent.frames("contents").location.href = "index.aspx";
           //Parent.frames("top").location.href = "top.aspx"
        }
        function RefreshIndex()
        {
           //On Error Resume Next
           top.frames.contents.location = "index.aspx";
           
           //Parent.frames("top").location.href = "top.aspx"
       }
       function OpenModal() {
           var MessageSource = "cmdDel";
           var MessageText = "Partnera dati tiks dzēsti. Vai turpināt?";
           var WinSettings = "center:yes;resizable:no;dialogHeight:200px;status:no";
           var RetVal = window.showModalDialog("ModalDlg.aspx", MessageText, WinSettings);
           //__doPostBack("cmdDelLn", "");
           //__doPostBack("cmdDel","");
           //$get('cmdDel').click();
           if (document.getElementById("_RESULT").textContent != "undefined")
               document.getElementById("_RESULT").textContent = RetVal + MessageSource;
           if (document.getElementById("_RESULT").innerText != "undefined")
               document.getElementById("_RESULT").innerText = RetVal + MessageSource;
           //document.getElementById('_RESULT').innerText = RetVal + MessageSource;
           __doPostBack('_RESULT', '');
           RefreshIndex();
           //document.getElementById('cmdDelH').click();

       }
       function overlay() {
           xyz = document.getElementById("overlay");
           xyz.style.visibility = (xyz.style.visibility == "visible") ? "hidden" : "visible";

       }

        -->
    </script>
    <link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body class="PageMain">
    <form id="form1" runat="server">
    <div id="overlay">
        <div align="center">
            <asp:Label ID="lblDelOrg" runat="server" CssClass="LabelFieldCaption" Text="Klients tiks dzēsts. Vai turpināt?"></asp:Label>
            <br />
            <asp:Button ID="cmdDelOKOrg" runat="server" CssClass="cmdDel" OnClientClick="overlay()"
                OnClick="cmdDelU_Click" Text="OK" />
            <asp:Button ID="cmdDelCancel" runat="server" CssClass="cmdClose" OnClientClick="overlay()"
                Text="Cancel" />
        </div>
    </div>
    <div align="center">
        <asp:Label ID="Label1" runat="server" CssClass="LabelPageCaption" 
            Text="Organizāciju saraksts"></asp:Label>
        <br />
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
    </div>
    <div style="height: 874px">
        <asp:Button ID="cmdNew" runat="server" CssClass="cmdNew" onclick="cmdNew_Click" 
            Text="Jauns ieraksts" Visible="False" />
        <br />
        <asp:UpdatePanel ID="upEdit" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pEdit" runat="server" CssClass="PanelEdit" Height="778px" 
                    Visible="False">
                    <asp:TextBox ID="txtOrgID" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label2" runat="server" CssClass="LabelFieldCaption" 
                        Text="Organizācijas nosaukums"></asp:Label>
                    <a name="pEdit"></a>
                    <br />
                    <asp:TextBox ID="txtOrgName" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label3" runat="server" CssClass="LabelFieldCaption" 
                        Text="Reģistrācijas numurs"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtRegNr" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label4" runat="server" CssClass="LabelFieldCaption" 
                        Text="Adrese"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtAddress" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label5" runat="server" CssClass="LabelFieldCaption" 
                        Text="Tālrunis"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtPhone" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label6" runat="server" CssClass="LabelFieldCaption" 
                        Text="E-pasts"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtEmail" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label7" runat="server" CssClass="LabelFieldCaption" 
                        Text="Kontaktpersona"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtCPerson" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <br />
                    <asp:Label ID="Label8" runat="server" CssClass="LabelFieldCaption" 
                        Text="Pieejas tiesības lietotājiem"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtAccessU" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <asp:Button ID="cmdShowU" runat="server" CssClass="cmdShowLists" 
                        onclick="cmdShowU_Click" Text="..." />
                    <br />
                    <asp:GridView ID="gvAccessU" runat="server" AutoGenerateSelectButton="True" 
                        CssClass="TablePopUp" onselectedindexchanged="gvAccessU_SelectedIndexChanged" 
                        Visible="False">
                    </asp:GridView>
                    <br />
                    <asp:Label ID="Label9" runat="server" CssClass="LabelFieldCaption" 
                        Text="Pieejas tiesības grupām"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtAccessG" runat="server" CssClass="FieldsText"></asp:TextBox>
                    <asp:Button ID="cmdShowG" runat="server" CssClass="cmdShowLists" 
                        onclick="cmdShowG_Click" Text="..." />
                    <br />
                    <asp:GridView ID="gvAccessG" runat="server" AutoGenerateSelectButton="True" 
                        CssClass="TablePopUp" onselectedindexchanged="gvAccessG_SelectedIndexChanged" 
                        Visible="False">
                    </asp:GridView>
                    <div align="center">
                        <asp:Label ID="lblErr" runat="server" CssClass="LabelError"></asp:Label>
                        <br />
                        <asp:Button ID="cmdSave" runat="server" CssClass="cmdSave" 
                            onclick="cmdSave_Click" Text="Saglabāt" onclientclick="RefreshIndex()" />
                        &nbsp;<asp:Button ID="cmdDelU" runat="server" CssClass="cmdDel" 
                            onclick="cmdDelU_Click" Text="Dzēst" onclientclick="RefreshIndex()" 
                            Visible="False" />
                        &nbsp;<asp:Button ID="cmdDelMod" runat="server" CssClass="cmdDel" 
                            onclientclick="overlay()" Text="Dzēst" />
                        &nbsp;<asp:Button ID="cmdCloseU" runat="server" CssClass="cmdClose" 
                            onclick="cmdCloseU_Click" Text="Aizvērt" onclientclick="RefreshIndex()" />
                        <br />
                        <asp:TextBox ID="_RESULT" runat="server" CssClass="FieldsUnvisible"></asp:TextBox>
                    </div>
                    <br />
                </asp:Panel>
                <br />
                <asp:UpdatePanel ID="upList" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div align="center">
                            <asp:Panel ID="pFilters" runat="server">
                            </asp:Panel>
                        </div>
                        <br />
                        <asp:Table ID="tOrg" runat="server" CssClass="TableList" GridLines="Both">
                        </asp:Table>
                        <br />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="cmdNew" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
